package com.gxc.config;

import com.gxc.filter.MyFilter;
import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * WebMvcConfigBean.
 *
 * @author 宫新程
 * @since 2019/1/14 1:37 PM
 */
@Configuration
@EnableScheduling
public class WebMvcConfigBean {

  /** 配置过滤器. */
  @Bean
  public FilterRegistrationBean<MyFilter> filterRegistrationBean() {
    FilterRegistrationBean<MyFilter> registrationBean = new FilterRegistrationBean<>();
    registrationBean.setFilter(new MyFilter());
    List<String> list = new ArrayList<>();
    list.add("/*");
    registrationBean.setUrlPatterns(list);
    return registrationBean;
  }
}
